<script type="text/javascript">
    function addFile()
    {
        var form = document.getElementById('fileContainer');
        var fileNode = document.createElement("input");
        var brNode = document.createElement("br");
        fileNode.type = "file";
        fileNode.name = "file[]";
        form.appendChild(fileNode);
        form.appendChild(brNode);
        var nof = document.getElementById('nof');
        nof.value = parseInt(nof.value) + 1;        
    }
</script>
    
<div class="art-post">
    <div class="art-post-tl"></div>
    <div class="art-post-tr"></div>
    <div class="art-post-bl"></div>
    <div class="art-post-br"></div>
    <div class="art-post-tc"></div>
    <div class="art-post-bc"></div>
    <div class="art-post-cl"></div>
    <div class="art-post-cr"></div>
    <div class="art-post-cc"></div>
    <div class="art-post-body">
        <div class="art-post-inner art-article">
            <h2 class="art-postheader">[Images upload]</h2>

                <!--  start table-content  -->
                <div id="table-content">
					<?php
						if(isset($uploadedFiles))
						{
							?>
							<table border="0" width="100%" cellpadding="0" cellspacing="0" id="product-table">
								<thead>
								<tr>
									<th class="table-header-repeat line-left minwidth-1"><a href="">Preview</a></th>
									<th class="table-header-repeat line-left"><a href="">Link</a></th>
								</tr>
								</thead>
								<tbody>
								<?php
									foreach($uploadedFiles as $location)
									{
										?>
										<tr>
											<td><img src="<?php echo Utility::baseUrl() . $location;?>" style="max-width: 150px;" /></td>
											<td><input type="text" value="<?php echo Utility::baseUrl()  . $location;?>" style="width: 80%" /></td>
										</tr>
										<?php
									}
								?>
							</table>
							<?php
						}
					?>
                    <form id="uploadForm" method="post" action="<?php echo Utility::getSiteUrl(); ?>/upload/submit" enctype="multipart/form-data">
					
					<div id="fileContainer">
						<?php
							for($i = 0; $i < $numberOfFile; $i++)
							{
							?>
							<input type="file" class="file_1" name="file[]" />
							<?php
							}
							?>
					</div>
					
					</table>
					<!--<input type="hidden" name="nof" value="<?php echo $numberOfFile; ?>" id="nof" />-->
					<input type="button" name="addBtn" onclick="addFile()" value="Add file" />
					<input type="submit" name="submit" value="Upload" />
				</form>


                
        </div>

        <div class="cleared"></div>
    </div>
</div>